package com.example.cloudstreamdemo.function;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.util.function.Consumer;

/**
 * MQ消费者函数
 *
 * @author 吕晓飞
 * @version 1.0
 * @since 2024/1/16 17:47
 */
@Component
public class MQFunction {

    /**
     * 消费者1
     */
    @Bean
    Consumer<String> consumer_1() {
        return msgBody -> {
            System.out.println("消费者1: " + msgBody);
        };
    }

    /**
     * 消费者2
     */
    @Bean
    Consumer<String> consumer_2() {
        return msgBody -> {
            System.out.println("消费者2: " + msgBody);
        };
    }
}
